var INDEX_PAGE = {
    init : function() {
        INDEX_PAGE.initUI();
        INDEX_PAGE.initEvent();
        INDEX_PAGE.uiState();
    },

    initUI : function() {
        
    },

    initEvent : function() {
        
    },

    uiState : function() {
        
    },

    onLogin : function() {
        var options = {
            target: '#output1',
            beforeSubmit: function() {
                alert('beforesubmit');
            },
            success: function() {
                alert('success');
            },
            dataType: 'json', // 'xml', 'script' or 'json' (expected server response type)
        }

        $('#loginForm').ajaxForm(options).submit(function() {return false});
    },

    gotoRegiester : function() {
        window.location = "/register.htm";
    },

    gotoPages : function(page) {
        if (page == 'wxzx') {
            window.location = '/news.htm'; // 网校资讯
        } else if (page == 'kszn') {
            window.location = '/exam_dynamic.htm'; // 考试指南
        } else if (page == '') {
            // 心理测试
        } else if (page == 'alxx') {
            window.location = '/case_study.htm'; // 案例学习
        } else if (page == '') {
            // 心融杂志
        } else if (page == '') {
            // 德瑞姆家园
        }
    }
};
jQuery(document).ready(INDEX_PAGE.init);




function course(j,numb){
        for(var i=1;i<=numb;i++){
                if (i==j){                        
                      document.getElementById("course0"+i).style.backgroundColor="#FBFBFB";
					  document.getElementById("coursediv0"+i).style.display="block";						
                        }
                else {
                     document.getElementById("course0"+i).style.background="#F2F2F2";
					 document.getElementById("coursediv0"+i).style.display="none";      
                        }
        }
}


function dynamic(j,numb){
        for(var i=1;i<=numb;i++){
                if (i==j){                        
                      document.getElementById("dynamictab0"+i).style.backgroundColor="#FFF";
					  document.getElementById("dynamic0"+i).style.display="block";						
                        }
                else {
                     document.getElementById("dynamictab0"+i).style.background="#F7F7F7";
					 document.getElementById("dynamic0"+i).style.display="none";      
                        }
        }
}


function exam(j,numb){
        for(var i=1;i<=numb;i++){
                if (i==j){                        
                      document.getElementById("examtab0"+i).style.backgroundColor="#FFF";
					  document.getElementById("exam0"+i).style.display="block";						
                        }
                else {
                     document.getElementById("examtab0"+i).style.background="#F7F7F7";
					 document.getElementById("exam0"+i).style.display="none";      
                        }
        }
}


function readyexam(j,numb){
        for(var i=1;i<=numb;i++){
                if (i==j){                        
                      document.getElementById("readyexamtab0"+i).style.backgroundColor="#FFF";
					  document.getElementById("readyexam0"+i).style.display="block";						
                        }
                else {
                     document.getElementById("readyexamtab0"+i).style.background="#F7F7F7";
					 document.getElementById("readyexam0"+i).style.display="none";      
                        }
        }
}

function casestudy(n,count){
        for(var i=1;i<=count;i++){
                if (i==n){                        
                      document.getElementById("casestudytab0"+i).style.backgroundColor="#FFF";
					  document.getElementById("casestudy0"+i).style.display="block";						
                        }
                else {
                     document.getElementById("casestudytab0"+i).style.background="#F7F7F7";
					 document.getElementById("casestudy0"+i).style.display="none";      
                        }
        }
}
